home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Graphics Programming (2nd Edition) / Visual Basic Graphics Programming 2nd Edition.iso / OldSrc / CH11 / SRC / APIFUNCS.BAS < prev    next >
BASIC Source File  |  1996-05-04  |  3KB  |  45 lines

  1. Attribute VB_Name = "ApiFuncs"
  2. Option Explicit
  3.  
  4. ' Pen constants.
  5. Global Const PS_SOLID = 0
  6. Global Const WHITE_PEN = 6
  7. Global Const BLACK_PEN = 7
  8.  
  9. Global Const GRAY_BRUSH = 2
  10. Global Const BLACK_BRUSH = 4
  11.  
  12. Global Const ALTERNATE = 1  ' Polygon fill mode.
  13.  
  14. #If Win32 Then
  15.     Type POINTAPI
  16.         x As Long
  17.         y As Long
  18.     End Type
  19.     Declare Function GetStockObject Lib "gdi32" (ByVal nIndex As Long) As Long
  20.     Declare Function SelectObject Lib "gdi32" (ByVal hdc As Long, ByVal hObject As Long) As Long
  21.     Declare Function SetPolyFillMode Lib "gdi32" (ByVal hdc As Long, ByVal nPolyFillMode As Long) As Long
  22.     Declare Function Polyline Lib "gdi32" (ByVal hdc As Long, lpPoint As POINTAPI, ByVal nCount As Long) As Long
  23.     Declare Function Polygon Lib "gdi32" (ByVal hdc As Long, lpPoint As POINTAPI, ByVal nCount As Long) As Long
  24.     Declare Function API_MoveTo Lib "gdi32" Alias "MoveToEx" (ByVal hdc As Long, ByVal x As Long, ByVal y As Long, lpPoint As Any) As Long
  25.     Declare Function API_LineTo Lib "gdi32" Alias "LineTo" (ByVal hdc As Long, ByVal x As Long, ByVal y As Long) As Long
  26.     Declare Function CreatePen Lib "gdi32" (ByVal nPenStyle As Long, ByVal nWidth As Long, ByVal crColor As Long) As Long
  27.     Declare Function CreateSolidBrush Lib "gdi32" (ByVal crColor As Long) As Long
  28.     Declare Function DeleteObject Lib "gdi32" (ByVal hObject As Long) As Long
  29. #Else
  30.     Type POINTAPI
  31.         x As Integer
  32.         y As Integer
  33.     End Type
  34.     Declare Function GetStockObject Lib "GDI" (ByVal nIndex As Integer) As Integer
  35.     Declare Function SelectObject Lib "GDI" (ByVal hdc As Integer, ByVal hObject As Integer) As Integer
  36.     Declare Function SetPolyFillMode Lib "GDI" (ByVal hdc As Integer, ByVal nPolyFillMode As Integer) As Integer
  37.     Declare Function Polyline Lib "GDI" (ByVal hdc As Integer, lpPoints As POINTAPI, ByVal nCount As Integer) As Integer
  38.     Declare Function Polygon Lib "GDI" (ByVal hdc As Integer, lpPoints As POINTAPI, ByVal nCount As Integer) As Integer
  39.     Declare Function API_MoveTo Lib "GDI" Alias "MoveTo" (ByVal hdc As Integer, ByVal x As Integer, ByVal y As Integer) As Long
  40.     Declare Function API_LineTo Lib "GDI" Alias "LineTo" (ByVal hdc As Integer, ByVal x As Integer, ByVal y As Integer) As Integer
  41.     Declare Function CreatePen Lib "GDI" (ByVal nPenStyle As Integer, ByVal nWidth As Integer, ByVal crColor As Long) As Integer
  42.     Declare Function CreateSolidBrush Lib "GDI" (ByVal crColor As Long) As Integer
  43.     Declare Function DeleteObject Lib "GDI" (ByVal hObject As Integer) As Integer
  44. #End If
  45.